<?php

/**
 * 
 *
 * @version $Id: misc.inc.php,v 1.7 2005/01/06 17:54:17 phppc Exp $
 * @copyright 2004 
 * @desc misc component
 **/


$this->ncs = $this->fun_sg2var($this->config["ncs_var"]);
$this->main_abfrage = "SELECT ".$this->config["prefix"]."main.news_id AS news_id, ".$this->config["prefix"]."main.n_title AS n_title, ".$this->config["prefix"]."main.n_text AS n_text, ".$this->config["prefix"]."main.links AS links, ".$this->config["prefix"]."main.kat AS kat_id, ".$this->config["prefix"]."main.user_id AS user_id, ".$this->config["prefix"]."main.time_start AS time_start, ".$this->config["prefix"]."main.time_end AS time_end, ".$this->config["prefix"]."main.anzahl_coms AS anzahl_coms,".$this->config["prefix"]."main.allow_coms AS allow_coms
FROM ".$this->config["prefix"]."main  WHERE ".$this->config["prefix"]."main.active=\"1\" ";
$this->where_time = " AND (".$this->config["prefix"]."main.time_start <= ".time().") AND (".$this->config["prefix"]."main.time_end >= ".time()." OR ".$this->config["prefix"]."main.time_end = \"0\") ";

$this->db_set_config($this->config["dbhost"],$this->config["dbusname"],$this->config["dbpw"],$this->config["dbname"]);

$this->db_config = $this->db_abfrage_az("SELECT * FROM ".$this->config["prefix"]."config");
$this->nc_style = $this->db_abfrage_az("SELECT ".$this->config["prefix"]."style.id AS style_id,".$this->config["prefix"]."style.name AS style_name,".$this->config["prefix"]."style.css_id AS css_id,".$this->config["prefix"]."style.tpl_dir AS tpl_dir,".$this->config["prefix"]."style.cs AS cs,".$this->config["prefix"]."style.cp AS cp,".$this->config["prefix"]."css.css_code AS css_code FROM ".$this->config["prefix"]."style LEFT JOIN ".$this->config["prefix"]."css ON (".$this->config["prefix"]."style.css_id=".$this->config["prefix"]."css.id) WHERE ".$this->config["prefix"]."style.id=\"".$this->db_config["default_style"]."\"");

$this->config["aktuelle_zeit"] = time();
$this->config["ip"] = $_SERVER["REMOTE_ADDR"];
$this->config["akt_rel_pfad"] = $_SERVER["REQUEST_URI"];

$this->config["uid_var"] = $this->config["cookie_name"] . "phpnc_admin_userid";
$this->config["upw_var"] = $this->config["cookie_name"] . "phpnc_admin_userpw";

if(isset($_COOKIE[$this->config["uid_var"]])) $this->config["cookie_uid"] = $_COOKIE[$this->config["uid_var"]];
if(isset($_COOKIE[$this->config["upw_var"]])) $this->config["cookie_upw"] = $_COOKIE[$this->config["upw_var"]];

$this->news_id = $this->fun_sg2var("news_id");

$this->cs = 1;
$this->cp = 1;

?>